<?php
if(empty($_POST['xinxi'])){
    exit;
}
include "sql.php";
$xuehao=$_COOKIE['xuehao'];
$cha=$con->query("select * from user where xuehao='{$xuehao}'");
$res=array();
foreach($cha as $val){
    $res=$val;
}
$order=rand(1,100000000000).time();
$name=$res['name'];
$tel=$res['tel'];
$lou=$res['lou'];
$sushe=$res['sushe'];
$xinxi=$_POST['xinxi'];
$beizhu=$_POST['beizhu'];
$money=$_POST['money'];
$guige=$_POST['guige'];
$time=time();
$zhuru=$con->query("insert into userorder (orderhao,xuehao,username,tel,lou,sushe,beizhu,xinxi,guige,money,ctime,zhuangtai,mzhuangtai,otime) values('{$order}','{$xuehao}','{$name}','{$tel}','{$lou}','{$sushe}','{$beizhu}','{$xinxi}','{$guige}','{$money}','{$time}','0','0','0')");
if($zhuru=false){
echo "下单失败";
exit;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
<div id="main" style="width: 150px; margin: 30px auto 0 auto; ">


</div>
    <form action="pay/epayapi.php" method="get">
    <div style="display:none;">
    <input type="text" name="order" value="<?php echo $order; ?>">
    <input type="text" name="money" value="<?php echo $money; ?>">
  
    </div>
    <div style="width:250px;margin:0 auto;">
    <input type="radio" name="type" value="alipay" checked>支付宝
     <input type="radio" name="type" value="qqpay">QQ支付<br><br>
     <input type="submit" value="立即支付" style="background: chartreuse;width: 100px;height:50px; border-radius: 5px; border:none">
    </div>
   
     </form>
</body>
</html>